import { resetRouter, routes } from '@/router'
const state = {
  menuList: [...routes]
}
const getters = {}
const mutations = {
  setMenuList(state, filterRoutes) {
    state.menuList = [...state.menuList, ...filterRoutes]
  },
  resetMenuList(state) {
    // 1. 重置左侧菜单
    state.menuList = [...routes]
    // 2. 重置路由
    resetRouter()
  }
}
const actions = {}

export default {
  // 开启命名空间
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
